OCC Defining Macros
/Dxxx define a macro
This switch defines a macro as if a #define statement had been used somewhere in the source. It is useful for building different versions of a program without modifying the source files between compiles. Note that you may not give macros defined this way a value. For example:
OCC /DORANGE myfunc.c
is equivalent to placing the following statement in the file and compiling it.
#define ORANGE
Standard Predefined Macros
The following standard macros are predefined by the compiler:
Macro | Usage |
---|---|
__FILE__ | name of source file |
__DATE__ | the current date |
__DATEISO__ | the current date (ISO format) |
__TIME__ | the current time |
__LINE__ | the current line number |
Non-standard predefined macros
The following non-standard macros are predefined by the compiler:
Macro | Usage |
---|---|
__ORANGEC__ | always defined, value is "major version * 100 + minor version" |
__ORANGEC_MAJOR__ | always defined, value is "major version" |
__ORANGEC_MINOR__ | always defined, value is "minor version" |
__ORANGEC_PATCHLEVEL__ | always defined, value is "build number" |
__VERSION__ | always defined, rendition of the major/revision/minor/build as a string |
__RTTI__ | defined when C++ rtti/exception handling info is present |
__386__ | always defined |
__i386__ | always defined |
_i386_ | always defined |
__i386 | always defined |
__WIN32__ | defined for WIN32 |
_WIN32 | defined for WIN32 |
__DOS__ | defined for MSDOS |
__RAW_IMAGE__ | defined if building a raw image |
__LSCRTL_DLL | defined when LSCRTL.dll is in use |
__MSVCRT_DLL | defined when MSVCRT.dll is in use |
__CRTDLL_DLL | defined when CRTDLL.dll is in use |
__COUNTER__ | starts at 0 and increments every usage |